<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<!-- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> -->
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
		<title>公司起名</title>
		<link rel="stylesheet" href="./layui-v2.5.4/layui/css/layui.css">
		<script src="https://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.3.min.js"></script>
		<script src="random.min.js"></script>
		<style type="text/css">

			.layui-nav .layui-nav-item .tiny-color-white {
				color: #fff;
			}
			.layui-table {
				display: none;
			}
			.tiny-input-name-container{
				margin: 15px 0;
			}
			.tiny-center{
				text-align: center;
			}
			.tiny-show-color{
				color: #01AAED;
			}
			.Tiny-copyright{
				position: absolute;
				bottom: 5px;
				text-align: center;
				width: 100%;
				color: #eeeeee;
			}
		</style>
	</head>
	<body class="layui-layout-body">
		<ul class="layui-nav tiny-center">
			<li class="layui-nav-item ">
				<a href="#" class="tiny-color-white">郑州公司起名</a>
			</li>
		</ul>
		<div class="layui-container">
			<div class="tiny-input-name-container">
				<input type="text" name="" placeholder="请输入自定义名,如未定义,将随机生成" autocomplete="off" class="layui-input tiny-input-name">
			</div>
			<table class="layui-table layui-anim">
				<colgroup>
					<col width="100">
					<col width="250">
					<col>
				  </colgroup>
				<thead>
					<tr>
						<th>称呼</th>
						<th>公司名</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td>自定义名</td>
						<td class="tiny-random-customize tiny-show-color"></td>
					</tr>
					<tr>
						<td>随机名</td>
						<td class="tiny-random-all tiny-show-color"></td>
					</tr>
					<tr>
						<td>随机双名</td>
						<td class="tiny-random-two tiny-show-color"></td>
					</tr>
					<tr>
						<td>随机三名</td>
						<td class="tiny-random-three tiny-show-color"></td>
					</tr>
					<tr>
						<td>随机水</td>
						<td class="tiny-random-three-water tiny-show-color"></td>
					</tr>
					<tr>
						<td>随机火</td>
						<td class="tiny-random-three-fire tiny-show-color"></td>
					</tr>
					<tr>
						<td>随机木</td>
						<td class="tiny-random-three-wood tiny-show-color"></td>
					</tr>
				</tbody>
			</table>
			<div class="tiny-input-name-container">
				<button type="button" class="layui-btn layui-btn-fluid"id="tiny-refresh">点击生成公司名称</button>
			</div>
			<!-- <form class="layui-form">
				<div class="layui-form-item">
					<label class="layui-form-label">城市名</label>
					<div class="layui-input-block">
						<input type="text" name="" placeholder="默认郑州" autocomplete="off" class="layui-input tiny-one-name" value="郑州">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">自定义名</label>
					<div class="layui-input-block">
						<input type="text" name="" placeholder="请输入自定义名" autocomplete="off" class="layui-input tiny-input-name">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">后缀一</label>
					<div class="layui-input-block">
						<input type="text" name="" placeholder="网络科技有限公司" autocomplete="off" class="layui-input tiny-back-one" value="网络科技有限公司">
					</div>
				</div>


				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit lay-filter="*" id="tiny-refresh">刷新</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form> -->
			
		</div>
		<p class="Tiny-copyright">Copyright © Tiny</p>
		<script src="./layui-v2.5.4/layui/layui.js"></script>
		<script>
			//JavaScript代码区域
			layui.use(["element", "form"], function() {
				var element = layui.element;
				var form = layui.form;
				$('#tiny-refresh').click(function(e) {
					e.preventDefault();
					$('.layui-table').css('display', 'inline-block').addClass('layui-anim-scale');
					var customize = $('.tiny-input-name').val();
					if(customize == ''){
						var tiny_three_test = shuffle(Array.from(window.chineseRandomName.names.get3())).join();
					}else{
						var tiny_three_test = shuffle(Array.from(window.chineseRandomName.names.get3()+customize)).join();
					}
					var tiny_customize ='';
					for(var i=0;i<tiny_three_test.length;i+=2){
						tiny_customize = tiny_customize + tiny_three_test[i];
					}
					// console.log(tiny_three_test[0]+tiny_three_test[2]+tiny_three_test[4]+tiny_three_test[6]);
					var tiny_all = '郑州' + window.chineseRandomName.names.get() + '网络科技有限公司';
					var tiny_one = '郑州' + window.chineseRandomName.names.get1() + '网络科技有限公司';
					var tiny_two = '郑州' + window.chineseRandomName.names.get2() + '网络科技有限公司';
					var tiny_three = '郑州' + window.chineseRandomName.names.get3() + '网络科技有限公司';
					var tiny_water = '郑州' + window.chineseRandomName.names.get3('水水水') + '网络科技有限公司';
					var tiny_fire = '郑州' + window.chineseRandomName.names.get3('火火火') + '网络科技有限公司';
					var tiny_wood = '郑州' + window.chineseRandomName.names.get3('木木木') + '网络科技有限公司';
					tiny_customize ='郑州' + tiny_customize + '网络科技有限公司';
					$('.tiny-random-customize').html(tiny_customize);
					$('.tiny-random-all').html(tiny_all);
					$('.tiny-random-one').html(tiny_one);
					$('.tiny-random-two').html(tiny_two);
					$('.tiny-random-three').html(tiny_three);
					$('.tiny-random-three-water').html(tiny_water);
					$('.tiny-random-three-fire').html(tiny_fire);
					$('.tiny-random-three-wood').html(tiny_wood);
					
				});
				function shuffle(array) {
					for (var i = array.length - 1; i > 0; i--) {
						var j = Math.floor(Math.random() * (i + 1));
						var temp = array[i];
						array[i] = array[j];
						array[j] = temp;
					}
					return array;
				}
				
			});
		</script>
	</body>
</html>
